package com.hopu.blb_erp.controller;

import com.hopu.blb_erp.entity.ProductionProcessDetails;
import com.hopu.blb_erp.service.ProductionProcessDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api
@RestController
@Controller
public class ProduvtionprocessDetailController {
    @Autowired
    private ProductionProcessDetailsService productionProcessDetailsService;

    @ApiOperation("查询详情")
    @GetMapping("/ProductionProcessDetails")
    public ResponseEntity<List<ProductionProcessDetails>> findAllPage(@RequestParam("orderId") String id){
        int orderId = 0;
        System.out.println(id);
        if(!"".equals(id)){ orderId = Integer.parseInt(id); }
        return ResponseEntity.ok(productionProcessDetailsService.findAll(orderId)) ;
    }
}
